/**
 * 
 */
package com.netflexitysolutions.amazonws.sdb.orm.metadata;

import java.util.List;
import java.util.Set;


/**
 * @author netflexity
 *
 */
public class CollectionMetadata extends AttributeMetadata{

	private boolean inverse;
	private String targetColumnName;
	private Class<?> collectionClazz;
	private boolean isManyToMany;
	private boolean isOneToMany;
	
	/**
	 * 
	 */
	public CollectionMetadata() {
		setLazy(true);
	}
	
	/**
	 * @return the collectionClazz
	 */
	public Class<?> getCollectionClazz() {
		return collectionClazz;
	}

	/**
	 * @param collectionClazz the collectionClazz to set
	 */
	protected void setCollectionClazz(Class<?> collectionClazz) {
		this.collectionClazz = collectionClazz;
	}

	/**
	 * @param collectionClazz the collectionClazz to set
	 */
	public void setSet(String junk) {
		this.collectionClazz = Set.class;
	}

	/**
	 * @param collectionClazz the collectionClazz to set
	 */
	public void setBag(String junk) {
		this.collectionClazz = List.class;
	}
	
	/**
	 * @return the targetColumnName
	 */
	public String getTargetColumnName() {
		return targetColumnName;
	}

	/**
	 * @param targetColumnName the targetColumnName to set
	 */
	public void setTargetColumnName(String targetColumnName) {
		this.targetColumnName = targetColumnName;
	}

	/**
	 * @return the inverse
	 */
	public boolean isInverse() {
		return inverse;
	}

	/**
	 * @param inverse the inverse to set
	 */
	protected void setInverse(boolean inverse) {
		this.inverse = inverse;
	}

	/**
	 * @param inverse the inverse to set
	 */
	public void setInverse(String inverse) {
		this.inverse = new Boolean(inverse).booleanValue();
	}
	
	/**
	 * @return the isManyToMany
	 */
	public boolean isManyToMany() {
		return isManyToMany;
	}

	/**
	 * @param isManyToMany the isManyToMany to set
	 */
	public void setManyToMany(String junk) {
		this.isManyToMany = true;
	}

	/**
	 * @return the isOneToMany
	 */
	public boolean isOneToMany() {
		return isOneToMany;
	}

	/**
	 * @param isOneToMany the isOneToMany to set
	 */
	public void setOneToMany(String junk) {
		this.isOneToMany = true;
	}
}
